
from .Model.Models import Comment as CommentModel
from .Model.Models import Information as InformationModel
from .Model.Models import Report as ReportModel
from .Model.Models import UnSupport as UnSupportModel
from .Model.Models import User as UserModel
from .Model.Models import Admin as AdminModel
from flask_admin import Admin as Admin_Operate
from flask_admin.contrib.sqla import ModelView



def setAdmin(app,db):
    admin = Admin_Operate(app, name='管理系统', template_mode='bootstrap3')
    admin.add_view(ModelView(AdminModel, db.session,endpoint='adminset'))
    admin.add_view(ModelView(UserModel, db.session))
    admin.add_view(ModelView(InformationModel, db.session))
    admin.add_view(ModelView(CommentModel, db.session))
    admin.add_view(ModelView(ReportModel, db.session))
    admin.add_view(ModelView(UnSupportModel, db.session))
